/*
 *  Copyright 2004 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.model.core;

/**
 * <p>Content document. This is content resource which is actually some document
 * which has known type and can be parsed to extract (and index) its text. So,
 * content document is indexed and its content is a subject for full-text search.
 * </p>
 * <p>
 * Content Document has a {@link ContentLocale} attached to it. It's needed to
 * specify a language of document content. Also, a charset is specified for
 * document. This charset is one that is used to extract text from document.
 * For some documents, charset has no sense (PDF documents, for example).
 * Default charset is UTF-8.
 * </p>
 * <p><a href="ContentDocument.java.html"><i>View Source</i></a>
 * </p>
 *
 * @author Andrey Grebnev <a href="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
 * @version $Revision: 1.16 $ $Date: 2005/12/18 16:43:42 $
 * @see ContentResource
 * @struts.form include-all="false" extends="ContentResourceForm"
 * @hibernate.joined-subclass table="`al_core_document`" lazy="false"
 * @hibernate.joined-subclass-key column="`resource_id`"
 */
public class ContentDocument extends ContentResource {

	//~ Instance variables

    /**
     * The locale that is assigned to this document
     */
	protected ContentLocale contentLocale;
    /**
     * The charset of the document
     */
	protected String charset;

	//~ Methods

    /**
     * Returns the locale
     *
     * @return locale of the document
     * @hibernate.many-to-one column="`locale_identifier`" not-null="false" outer-join="false" lazy="false"
     * @struts.form-field
     * @struts.validator type="required"
     * @struts.validator-args arg0resource="core.contentResource.form.language"
     */
    public ContentLocale getContentLocale() {
        return contentLocale;
    }

    /**
     * Sets the content locale of this document
     *
     * @param contentLocale locale of the document
     */
    public void setContentLocale(ContentLocale contentLocale) {
        this.contentLocale = contentLocale;
    }

    /**
     * Returns the charset
     *
     * @return charset of the document
     * @hibernate.property
     * @hibernate.column name="`charset`" not-null="true" unique="false" length="252"
     * @struts.form-field
     * @struts.validator type="required"
     */
    public String getCharset() {
        return charset;
    }

    /**
     * Sets the charset of the document content
     *
     * @param charset the charset of document
     */
    public void setCharset(String charset) {
        this.charset = charset;
    }
}
